<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{margin: 0;padding: 0;list-style: none;}
        li{
            line-height:50px ;
            border-bottom: 1px solid gray;
        }
        span{
            margin: 0 15px;
        }
        .time{
            float: right;
        }
    </style>
</head>
<body>
    <div id="app">
        <ul>
            <li v-for="(item,index) in arr">
                <img src="" alt="图片">
                <span>{{item.reply_count}}/{{item.visit_count}}</span>
                {{item.title}}
                <span class="time">{{item.create_at | time}}</span>
            </li>
        </ul>
    </div>
</body>
<script src="js/vue.js"></script>
<script src="js/axios.min.js"></script>
<script>
    let vm = new Vue({
        el:"#app",
        data:{
            arr:[]
        },
        mounted(){
            axios.get("https://cnodejs.org/api/v1/topics",{
                    // headers: {'Content-Type': 'application/json;charser=UTF-8'},
                }).then(res=>{
                console.log(res.data.data);
                this.arr = res.data.data
            }).catch(err=>{
                console.log(err);
            })
        },
        filters:{
            time(val){
                console.log(val.replace(/T/g,'').replace(/\.[\d]{3}Z/,''));
                return val.replace(/T/g,' ').replace(/\.[\d]{3}Z/,'')
            }
        }

    })
</script>
</html>